[In]
drinks=['cola','water','juice']
fruit=['apple','orange','bananna','pineapple']
change = [1, 'pennies', 2, 'dollars', 3, 'millions']
for number in drinks:
print(f"There have {number}. ") #字串格式化
for fruits in fruit:
print(f"There have {fruits} juice.") #字串格式化
for x in change:
print(f"i got {x}")
element=[]
for x in range(0,5):
print(f"Adding{x} in the list")
element.append(x)
for x in element:
print(f"element was:{x}")
[Out]
There have cola.
There have water.
There have juice.
There have apple juice.
There have orange juice.
There have bananna juice.
There have pineapple juice.
i got 1
i got pennies
i got 2
i got dollars
i got 3
i got millions
Adding0 in the list
Adding1 in the list
Adding2 in the list
Adding3 in the list
Adding4 in the list
element was:4
element was:4
element was:4
element was:4
element was:4
目前已經完賽1/3了,各位是否有在前10篇文學到東西呢XD。